home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 414 < prev    next >
Internet Message Format  |  1996-08-06  |  1KB

  1. Path: news.rmii.com!usenet
  2. From: jcoffin@rmii.com (Jerry Coffin)
  3. Newsgroups: comp.std.c
  4. Subject: Re: CLOCKS_PER_SEC not defined
  5. Date: Fri, 16 Feb 1996 19:17:16 GMT
  6. Organization: TAEUS
  7. Message-ID: <4g2gp7$2s2@natasha.rmii.com>
  8. References: <ramin.1174728902A@news.gsfc.nasa.gov>
  9. NNTP-Posting-Host: slip22160.rmii.com
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. ramin@twinkie.gsfc.nasa.gov (Ramin Sina) wrote:
  13.  
  14. >I am using a supposedly ansi c program in which I write
  15.  
  16. >#include <time.h>
  17.  
  18. >#if defined(__STDC__) && !defined(CLOCKS_PER_SEC)
  19. >#error "CLOCKS_PER_SEC is not defined on this stupid compiler"
  20. >#endif
  21.  
  22. >I get the error that CLOCKS_PER_SEC is not defined. I had thought that it
  23. >was defined in standard C in the time.h header. I need CLOCKS_PER_SEC to
  24. >time how long it takes for the program to run. Can anybody suggest how I can
  25. >fix this problem.
  26.  
  27. You might check for CLK_TCK being defined instead.  Prior to the
  28. standard, and even in early versions of the draft working paper for the
  29. C standard, this was used instead of CLOCKS_PER_SEC.  If memory serves,
  30. CLK_TCK is also defined in POSIX.
  31.  
  32.